import java.util.ArrayDeque;

public class TrappingRain42 {
    public int trap(int[] height) {
        if (height.length == 0) return 0;
        
        int sum = 0;
        
        ArrayDeque<Integer> stack = new ArrayDeque<>();
        stack.add(0);
        for (int i=1; i< height.length; i++) {
            if (height[i] <= stack.peek()) {
                stack.add(i);
            }else {
                while ( height[i] >= stack.peek() && !stack.isEmpty()) {
                    
                }
            }
        }
    }
}